<template>
  <div class="order-index" id="order-index">
    <order-breadcrumb></order-breadcrumb>
    <order-menus></order-menus>

    <div class="order-index-content">
      <order-search></order-search>
      <order-table></order-table>
    </div>
  </div>
</template>

<script>
import '../../styles/orders/index.scss'
import OrderMenus from './components/orderMenus'
import OrderTable from './components/orderTable'
import OrderSearch from './components/orderSearch'
import OrderBreadcrumb from './components/orderBreadcrumb'
import { mapActions ,mapGetters} from 'vuex'
export default {
	computed: { ...mapGetters(['current_user'])},
  components: {
    OrderMenus,
    OrderSearch,
    OrderTable,
    OrderBreadcrumb
  }, 
  created() {
    // 初始化的时候获取一次列表page为1，type为all
    this.setOrders({ type: 'all', page: 1 })
    this.setMasters()
    this.setCompanies()
    this.updateSlideAction({role: this.current_user.role, user_type: this.current_user.user_type})
  },
  methods: {
    ...mapActions('orders', [
      'setOrders',
      'setMasters',
      'setCompanies',
      'updateSlideAction'
    ])
  }
}
</script>
